package org.shopen.puremvc.model.domain
{
	import org.shopen.puremvc.model.utils.Convert;
	
	public class OrganizationMeta implements ISerializable
	{
		[Bindable]
		private var _title : String = "";
		[Bindable]
		public function get title() : String
		{
			return _title;
		}
		public function set title(value : String) : void
		{
			_title = value;
		}
		
		[Bindable]
		private var _author : String = "";
		[Bindable]
		public function get author() : String
		{
			return _author;
		}
		public function set author(value : String) : void
		{
			_author = value;
		}
		
		public function OrganizationMeta(node : XML = null)
		{
			if (node != null)
			{
				deserialize(node);
			}
		}
		
		public function serialize() : XML
		{
			var resultNode : XML = <organization></organization>;
			resultNode.@title = title;
			resultNode.@author = author;
			
			return resultNode;
		}
		
		public function deserialize(node : XML) : void
		{
			if ("@title" in node)
			{
				title = Convert.toString(node.@title);
			}
			if ("@author" in node)
			{
				author = Convert.toString(node.@author);
			}			
		}
		
	}
}